function Notice(){
	this.getNotificationsUrl="/skyline/notice/list.html";
	this.getNotifications=function(){
		var url=this.getNotificationsUrl;
		var data=null;
		$.ajax({
			url: url,
			data:data,
			type : "GET",
			dataType:"json",
			contentType: "application/x-www-form-urlencoded; charset=utf-8", 
			success : function(msg){
				//alert(msg);
				var innerHTML="";
				var notificationsDiv=document.getElementById("notifications");
				innerHTML+="共"+msg.length+"条通知:<br>";
				for(var i=0;i<msg.length;i++){
					var notification=msg[i];
					innerHTML+=notice.getNotification(notification)+"<br>";
				}
				notificationsDiv.innerHTML=innerHTML;
			}
		});
	}
	this.getNotification=function(notification){
		var notiStr="";
		notiStr+="<a href='"+notification.notifierId+"'>"+notification.notifierNickname+"</a>";
		if(notification.secondNotifierId&&notification.secondNotifierId!=''){
			notiStr+="与<a href='"+notification.secondNotifierId+"'>"+notification.secondNotifierNickname+"</a>等";
		}
		if(notification.type=='ARTICLE_COMMENT'){
			notiStr+="在您的日志<a href='"+SKYLINE_VIEWNOTIFICATION+notification.id+".html'>"+notification.resourceTitle+"</a>回复了您。";
		}else	if(notification.type=='PHOTO_COMMENT'){
			notiStr+="在您的照片<a href='"+SKYLINE_VIEWNOTIFICATION+notification.id+".html'>"+notification.resourceTitle+"</a>回复了您。";
		}else if(notification.type=='ALBUM_COMMENT'){
			notiStr+="在您的相册<a href='"+SKYLINE_VIEWNOTIFICATION+notification.id+".html'>"+notification.resourceTitle+"</a>回复了您。";
		}else if(notification.type=='ATTENTION'){
			notiStr+="观注您。";
		}else if(notification.type=='SHORTMESSAGE_COMMENT'){
			notiStr+="在您的短消息<a href='"+SKYLINE_VIEWNOTIFICATION+notification.id+".html'>"+notification.resourceTitle+"</a>回复了您。";
		}else if(notification.type=='INVITATION'){
			notiStr+=" 给您发来  <a href='"+SKYLINE_VIEWNOTIFICATION+notification.id+".html'>"+notification.resourceTitle+"</a>";
		}
		return notiStr;
	}
	this.initial=function(){
		 newNotificationTimmer=setInterval("notice.getNotifications()",120000);
		 notice.getNotifications();
	}
}
var notice=new Notice();
//window.load+=s